import { BasicColumn } from '/@/components/Table/src/types/table';
import { useI18n } from '/@/hooks/web/useI18n';

const { t } = useI18n();

export function getWorkPlaceColumns(): BasicColumn[] {
  return [
    {
      title: t('routes.dashboard.workplaceSetting.projectName'),
      dataIndex: 'name',
      fixed: 'left',
      width: 200,
    },
    {
      title: t('routes.dashboard.workplaceSetting.projectStatus'),
      dataIndex: 'status',
      width: 100,
      slots: { customRender: 'status' },
    },
    {
      title: t('routes.dashboard.workplaceSetting.finishRatio'),
      dataIndex: 'completeRatio',
      width: 150,
      sorter: (a, b) => {
        return a.completeRatio > b.completeRatio ? 1 : -1;
      },
      slots: { customRender: 'completeRatio' },
    },
  ];
}
